package com.huawei123.hasee.cniao5store.mvp.presenter.impl;

import com.huawei123.hasee.cniao5store.api.IGetDataDelegate;
import com.huawei123.hasee.cniao5store.base.BaseActivity;
import com.huawei123.hasee.cniao5store.base.mvp_base.MvpPresenterImpl;
import com.huawei123.hasee.cniao5store.bean.AppDetailBean;
import com.huawei123.hasee.cniao5store.mvp.interactor.AppDetailInteractor;
import com.huawei123.hasee.cniao5store.mvp.presenter.AppDetailPresenter;
import com.huawei123.hasee.cniao5store.mvp.view.view.AppDetailActivityView;

import javax.inject.Inject;

/**
 * 项目名称：Cniao5Store
 * 类描述：
 * 创建人：luohao
 * 创建时间：2018/2/7 17:29
 * 修改人：luohao
 * 修改时间：2018/2/7 17:29
 * 修改备注：
 */

public class AppDetailPresenterImpl extends MvpPresenterImpl<AppDetailActivityView> implements AppDetailPresenter {
    @Inject
    AppDetailInteractor appDetailInteractor;

    @Inject
    public AppDetailPresenterImpl() {

    }

    @Override
    public void getAppDetailData(BaseActivity activity, String packageName) {
        appDetailInteractor.loadAppDetailData(activity, packageName, new IGetDataDelegate<AppDetailBean>() {
            @Override
            public void getDataSuccess(AppDetailBean appDetailBean) {
                myPresenterView.onAppDetailDataSuccess(appDetailBean);
            }

            @Override
            public void getDataError(String errmsg) {
                myPresenterView.onAppDetailDataError(errmsg);
            }
        });
    }
}
